<template>
  <div class="app-container">
    <div class="listBox">
      <div class="listBox_head">
        CoCo地址详情
      </div>
      <el-table v-loading="loading" :data="tabList" stripe border>
        <el-table-column label="序号" align="center" type="index" width="64px" />
        <el-table-column label="类别" align="center" prop="" :show-overflow-tooltip="true">
          <template slot-scope="scope">
            <dict-tag :options="statusType" :value="scope.row.type" />
          </template>
        </el-table-column>
        <el-table-column label="地址" align="center" prop="address" width="200" :show-overflow-tooltip="true" />
        <el-table-column label="账户初设置数量" align="center" prop="total" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column label="当前CoCo余额" align="center" prop="usable" :show-overflow-tooltip="true"></el-table-column>
        <el-table-column label="已发放CoCo数量" align="center" prop="used" :show-overflow-tooltip="true" />
      </el-table>
      <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getList" />
    </div>
  </div>
</template>

<script>
  import {
    cocoWalletList,
  } from "@/api/integralOperation";
  export default {
    // dicts: ['equity_card_issue_type', 'equity_card_sell_status'],
    name: "",
    components: {
      
    },
    data() {
      return {
        //日期
        date: [],
        // 遮罩层
        loading: false,
        statusType:[],
        // 总条数
        total: 0,
        // 表格数据
        tabList: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
        },
      };
    },
    created() {
      this.getDict();
      this.getList();
    },
    methods: {
      //获取状态字典
      getDict() {
        var dictType = "platform_coco_wallet_type";
        this.$getSelectList(dictType)
          .then((res) => {
            this.statusType = res.result[0].dictList;
          })
          .finally(() => {
            this.loading = false;
          });
      },
      /** 查询列表 */
      getList() {
        this.loading = true;
        cocoWalletList(this.queryParams).then(response => {
          this.tabList = response.result.records;
          this.total = response.result.total;
          this.loading = false;
        });
      },
    }
  };

</script>
<style scoped>
  .head {
    box-shadow: 0px 4px 12px 0px rgb(1 41 99 / 6%);
    background-color: #fff;
    border-radius: 8px;
    padding: 20px 20px 0;
  }

  .listBox {
    box-shadow: 0px 4px 12px 0px rgb(1 41 99 / 6%);
    background-color: #fff;
    border-radius: 8px;
    padding: 20px 20px;
    margin-top: 10px;
  }

  .listBox_head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
  }

</style>
